package com.atguigu.juc.chap01;

/**
 * @author Taeyang
 * @date 2025/3/31
 */
public class RunnableDemo {
    public static void main(String[] args) {
        new Thread(new T2()).start();

        System.out.println(Thread.currentThread().getName() + " is running");

        new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println(Thread.currentThread().getName() + " 匿名内部类Runnable线程");
            }
        },"匿名内部类").start();

        new Thread(() -> {
            System.out.println(Thread.currentThread().getName() + " Lambda Runnable线程");
        },"Lambda").start();
    }
}

class T2 implements Runnable {
    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName() + " Runnable线程");
    }
}
